import React from "react"
import {Map,Marker, InfoWindow} from "react-amap"
import "./index.less"
//  InfoWindow, 
export default class Amap extends React.Component {
    constructor() {
        super();
        this.mapCenter = {longitude: 121.47564, latitude:  31.27169 };
        this.state = {
            visible: true,
            offset:[0,-30],
            size: {
              width: 300,
              height: 140,
            },
        }
    }
    render() {
        const html = `<div>
            <h4>上海创谋建筑设计有限公司</h4>
            <div>
                <p>电话：(021) 56529708</p>
                <p>地址：上海虹口区中山北一路 花园坊 A2 栋 121 号 215 室</p>
            </div>
        </div>`;
        return (<div className="jz_map" style={{width: '100%', height: '380px'}}>
            <Map zoom={13} center={this.mapCenter} amapkey={'32fa7552c02016a5f6eefe2a3e062f87'}>
                <InfoWindow
                    position={this.mapCenter}
                    offset={this.state.offset}
                    isCustom={false}
                    content={html}
                    visible={this.state.visible}
                    size={this.state.size}
                />
                <Marker position={this.mapCenter}>
                   
                </Marker>
            </Map>
        </div>);
    }
}